package java8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by Administrator on 2022/10/24.
 */
public class LambdaDemo2 {
    public static void main(String[] args) {
        List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
        List<Integer> doubledNumbers =
                numbers.stream()
                        .map(x -> 2 * x)
                        .collect(Collectors.toList());
        System.out.println(doubledNumbers);
    }
}
